<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="node_modules/jquery/dist/jquery.min.js"></script>
</head>

<body>

    <div class="content">
        <label class="cnd">描述：</label>
        <div class="sm">
            <textarea type="text" id="Introduce" name="Introduce" class="textarea" maxlength="300" style="resize:none;"
                ></textarea>
                    </textarea>
        </div>

    </div>
    <div class="word">
        <label class="cm"></label>
        <div class="title2"><span id="cost_tpl_title_length"></span></div>
    </div>

    <script>
        //字节统计
        function CountStrByte(obj, maxlength, id) {
            setTimeout(function () {
                var remlength = maxlength - obj.value.length;
                var wid = id;
                if (remlength < 0) {
                    remlength = 0;
                }
                document.getElementById(wid).innerHTML = "您还可以输入" + remlength + "字数";

            }, 100);
        }
        $('#Introduce').keyup(function (e) {
            CountStrByte(this, 10, 'cost_tpl_title_length')
        })
    </script>
  
</body>

</html>